template<class T>
T* search(BSTNode<T>* p, const T& el) const {
    while (p != 0)
        if (el == p->el)
            return &p->el;
        else if (el > p->el)
             p->right;
        else p->left;
    return 0;
}

template<class T>
void BST<T>::breadthFirst() {
    Queue<BSTNode<T>*> queue;
    BSTNode<T> *p= root;
    if(p != 0) {
        queue.enqueue(p);

        while(!queue.empty()) {
            p = queue.dequeue();
            visit(p);
            if (p->left != 0)
                queue.enqueue(p->left);
            if (p->right != 0)
                queue.enqueue(p->right);
        }
    }  
}

template<class T>
void BST<T>:: inorder(BSTNode<T> *p) {
    if (p != 0) {
        
    }
}